The present invention relates to a technology for managing a memory of a computer unit and more specifically to a technology for managing a memory of a computer unit such as a car controlling unit whose memory capacity is limited.
A stack area 300 used by each task is reserved on RAM (Random Access Memory) per each task in a multi-task system, which processes a plurality of tasks concurrently on a computer. As shown in FIG. 5(a), a task program and an interrupt program use there served stack area 300 in general. Then, when interrupt processing occurs while executing processing of a task 1, for example, the interrupt processing utilizes an area not used by the task program in the stack area 300 for the task 1. Considered from the nature of the interrupt processing, it is required to operate reliably at any time whenever it occurs. Therefore, the task area 300 has to reserve a capacity, which enables to operate a task processing, and a capacity that enables to operate all the interrupt processing per task.
Accordingly, when a number of tasks increases, the RAM utilization efficiency drops, while the capacity of the RAM to be reserved increases. This is not a big problem for a computer with a plenty of memory. However, the above-mentioned problem is serious for a car controlling unit, which is mounted on a car, because the capacity of the RAM is limited.
Japanese Patent Laid-Open No. Hei. 123698/1996 has disclosed, as shown in FIG. 5(b), a technology of reserving in a stack area only a task area 301 per task and only one interrupt area 303 in common to all tasks. This technology enables to suppress the increase of required amount of the RAM because it is only the task area that is to be reserved anew and the interrupt area is utilized in common, even when the number of tasks increases.
However, when multiplex interruption is considered, this technology requires reserving areas corresponding to the maximum number of interruptions, which may occur concurrently. Therefore, the required amount of the RAM cannot be reduced.
In view of the circumstances described above, it is an object of the present invention to provide a car controlling unit that allows a multiple interrupt processing, where the increase of required amount of RAM can be suppressed.
In order to achieve the above-mentioned object, a car controlling unit comprises, interrupt request issuing means for issuing an interrupt request which is associated with one of a plurality of interrupt levels which indicates a priority of interrupt processing; an interrupt controller which receives the interrupt request and decides whether or not to allow the interrupt request based on the interrupt level associated with the interrupt request thus received; a central processing unit which executes a task processing and an interrupt processing, and when an interrupt request is allowed, the central processing unit temporarily suspends the task processing or the interrupt processing to execute the interrupt processing whose interrupt request has been allowed; and a memory having a plurality of task areas utilized as a stack by the task processing and a plurality of interrupt areas utilized as a stack by the interrupt processing, wherein, the number of the interrupt areas is equal to the number of the interrupt levels, and the central processing unit utilizes any one of the task areas as a stack in executing each of the task processings, and utilizes any one of the interrupt areas as a stack in executing the interrupt processing whose interrupt request has been allowed.